package com.example.sqlitedata;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class MySQLiteOpenHelper extends SQLiteOpenHelper {
    public MySQLiteOpenHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String CarPeccancy ="create table CarPeccancy(_id integer primary key autoincrement,carnumber Text,pcode Text,pdatatime Text,paddr Text)";
        String Sense = "create table Sense(_id integer primary key autoincrement,Co2 integer,Pm25 integer,LightIntensity integer,humidity integer,temperature integer)";
        String CarInfor = "create table CarInfor(_id integer primary key autoincrement,carnumber Text,number Text,pcardid Text,buydata Text,carbrand Text)";

        db.execSQL(CarPeccancy);
        db.execSQL(Sense);
        db.execSQL(CarInfor);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
